@use "./variables" as *;
@use "./mixins" as *;

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica Neue, Helvetica, PingFang SC, Microsoft YaHei, Arial, sans-serif;
}

#app {
  height: 100%;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: $background-color-base;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: $text-secondary;
  border-radius: 3px;
  
  &:hover {
    background: $text-regular;
  }
}

.el-menu {
  border-right: none !important;
}

.el-menu-item.is-active {
  background-color: #263445 !important;
}

.el-menu-item:hover {
  background-color: #263445 !important;
}

.el-sub-menu__title:hover {
  background-color: #263445 !important;
}

.app-container {
  padding: 20px;
}

.search-wrapper {
  margin-bottom: 20px;
}

.table-wrapper {
  margin-bottom: 20px;
}

.pagination-container {
  margin-top: 20px;
  text-align: right;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-item-link {
  color: $primary-color;
  cursor: pointer;
  margin-left: 10px;
  
  &:hover {
    text-decoration: underline;
  }
}

.avatar-uploader {
  .el-upload {
    border: 1px dashed $border-color-base;
    border-radius: $border-radius-base;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    
    &:hover {
      border-color: $primary-color;
    }
  }
}

.avatar-uploader-icon {
  font-size: 28px;
  color: $text-secondary;
  width: 100px;
  height: 100px;
  text-align: center;
  line-height: 100px;
}

.avatar {
  width: 100px;
  height: 100px;
  display: block;
}

.fade-transform-enter-active,
.fade-transform-leave-active {
  transition: $transition-all;
}

.fade-transform-enter-from {
  opacity: 0;
  transform: translateX(-30px);
}

.fade-transform-leave-to {
  opacity: 0;
  transform: translateX(30px);
}

.app-wrapper {
  @include flex(column);
  position: relative;
  height: 100%;
  width: 100%;
}

.main-container {
  min-height: 100%;
  transition: margin-left 0.3s;
  margin-left: $sidebar-width;
  position: relative;
  background-color: $background-color-base;
}

.sidebar-container {
  transition: width 0.3s;
  width: $sidebar-width;
  height: 100%;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1001;
  overflow: hidden;
  background-color: #304156;
  
  &.is-collapse {
    width: $sidebar-collapse-width;
  }
}

.navbar {
  height: $header-height;
  overflow: hidden;
  position: relative;
  background: #fff;
  box-shadow: $box-shadow-light;
  
  .hamburger {
    display: inline-block;
    vertical-align: middle;
    width: 20px;
    height: 20px;
    cursor: pointer;
  }
  
  .breadcrumb {
    display: inline-block;
    padding-left: 15px;
  }
  
  .right-menu {
    float: right;
    height: 100%;
    padding-right: 15px;
    
    .avatar-container {
      margin-right: 30px;
      
      .avatar-wrapper {
        margin-top: 5px;
        position: relative;
        
        .user-avatar {
          cursor: pointer;
          width: 40px;
          height: 40px;
          border-radius: $border-radius-base;
        }
        
        .el-icon-caret-bottom {
          cursor: pointer;
          position: absolute;
          right: -20px;
          top: 25px;
          font-size: $font-size-extra-small;
        }
      }
    }
  }
}
